import '../tooltip.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'treemap_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TreeMapEmphasis {
  var focus;
  var blurScope;
  SeriesLabel? label;
  LabelLine? labelLine;
  SeriesLabel? upperLabel;
  SeriesItemStyle? itemStyle;

  TreeMapEmphasis(
      {this.focus,
      this.blurScope,
      this.label,
      this.labelLine,
      this.upperLabel,
      this.itemStyle});

  factory TreeMapEmphasis.fromJson(Map<String, dynamic> json) =>
      _$TreeMapEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$TreeMapEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TreeMapBlurSelectEmphasis {
  SeriesLabel? label;
  LabelLine? labelLine;
  SeriesLabel? upperLabel;
  SeriesItemStyle? itemStyle;

  TreeMapBlurSelectEmphasis(
      {this.label, this.labelLine, this.upperLabel, this.itemStyle});

  factory TreeMapBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$TreeMapBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$TreeMapBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class BreadcrumbEmphasis {
  SeriesItemStyle? itemStyle;

  BreadcrumbEmphasis({this.itemStyle});

  factory BreadcrumbEmphasis.fromJson(Map<String, dynamic> json) =>
      _$BreadcrumbEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$BreadcrumbEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Breadcrumb {
  var show;
  var left;
  var top;
  var right;
  var bottom;
  var height;
  var emptyItemWidth;
  SeriesItemStyle? itemStyle;
  BreadcrumbEmphasis? emphasis;

  Breadcrumb(
      {this.show,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.height,
      this.emptyItemWidth,
      this.itemStyle,
      this.emphasis});

  factory Breadcrumb.fromJson(Map<String, dynamic> json) =>
      _$BreadcrumbFromJson(json);

  Map<String, dynamic> toJson() => _$BreadcrumbToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TreeMapLevel {
  var visualDimension;
  var visualMin;
  var visualMax;

  var color;

  var colorAlpha;
  var colorSaturation;

  var colorMappingBy;
  var visibleMin;
  var childrenVisibleMin;

  SeriesLabel? label;
  SeriesLabel? upperLabel;

  SeriesItemStyle? itemStyle;

  TreeMapBlurSelectEmphasis? emphasis;

  TreeMapBlurSelectEmphasis? blur;

  TreeMapBlurSelectEmphasis? select;

  TreeMapLevel(
      {this.visualDimension,
      this.visualMin,
      this.visualMax,
      this.color,
      this.colorAlpha,
      this.colorSaturation,
      this.colorMappingBy,
      this.visibleMin,
      this.childrenVisibleMin,
      this.label,
      this.upperLabel,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select});

  factory TreeMapLevel.fromJson(Map<String, dynamic> json) =>
      _$TreeMapLevelFromJson(json);

  Map<String, dynamic> toJson() => _$TreeMapLevelToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TreeMapData {
  var value;
  var id;
  var name;
  var visualDimension;
  var visualMin;
  var visualMax;
  var color;
  var colorAlpha;
  var colorSaturation;
  var colorMappingBy;
  var visibleMin;
  var childrenVisibleMin;

  SeriesLabel? label;
  SeriesLabel? upperLabel;
  SeriesItemStyle? itemStyle;
  TreeMapBlurSelectEmphasis? emphasis;
  TreeMapBlurSelectEmphasis? blur;
  TreeMapBlurSelectEmphasis? select;
  var link;
  var target;
  var children;
  Tooltip? tooltip;

  TreeMapData(
      {this.value,
      this.id,
      this.name,
      this.visualDimension,
      this.visualMin,
      this.visualMax,
      this.color,
      this.colorAlpha,
      this.colorSaturation,
      this.colorMappingBy,
      this.visibleMin,
      this.childrenVisibleMin,
      this.label,
      this.upperLabel,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select,
      this.link,
      this.target,
      this.children,
      this.tooltip});

  factory TreeMapData.fromJson(Map<String, dynamic> json) =>
      _$TreeMapDataFromJson(json);

  Map<String, dynamic> toJson() => _$TreeMapDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TreeMapSeries extends Series {
  var id;
  var type = 'treemap';
  var name;
  var zlvel;
  var z;
  var left;
  var top;
  var right;
  var bottom;
  var width;
  var height;
  var squareRatio;
  var leafDepth;
  var drillDownIcon;
  var roam;
  var nodeClick;
  var zoomToNodeRatio;
  var visualDimension;
  var visualMin;
  var visualMax;
  var colorAlpha;
  var colorSaturation;
  var colorMappingBy;
  var visibleMin;
  var childrenVisibleMin;

  SeriesLabel? label;
  SeriesLabel? upperLabel;
  SeriesItemStyle? itemStyle;
  TreeMapEmphasis? emphasis;
  TreeMapBlurSelectEmphasis? blur;
  TreeMapBlurSelectEmphasis? select;

  var selectedMode;

  Breadcrumb? breadcrumb;

  LabelLine? labelLine;

  LabelLayout? labelLayout;

  List<TreeMapLevel>? levels;

  List<TreeMapData>? data;

  var silent;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  Tooltip? tooltip;

  TreeMapSeries(
      {this.id,
      this.name,
      this.zlvel,
      this.z,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.width,
      this.height,
      this.squareRatio,
      this.leafDepth,
      this.drillDownIcon,
      this.roam,
      this.nodeClick,
      this.zoomToNodeRatio,
      this.visualDimension,
      this.visualMin,
      this.visualMax,
      this.colorAlpha,
      this.colorSaturation,
      this.colorMappingBy,
      this.visibleMin,
      this.childrenVisibleMin,
      this.label,
      this.upperLabel,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select,
      this.selectedMode,
      this.breadcrumb,
      this.labelLine,
      this.labelLayout,
      this.levels,
      this.data,
      this.silent,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.tooltip});

  factory TreeMapSeries.fromJson(Map<String, dynamic> json) =>
      _$TreeMapSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$TreeMapSeriesToJson(this);
}
